<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>Introduction_to_Algorithms: src/graph_algorithms/max_flow/generic_push_relabel/genericpushrelabel.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Introduction_to_Algorithms
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('genericpushrelabel_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">genericpushrelabel.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="genericpushrelabel_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright 2016- huaxz &lt;huaxz1986@163.com&gt;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * This program is free software: you can redistribute it and/or modify</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * the Free Software Foundation, either version 2 of the License, or</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * (at your option) any later version.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * GNU General Public License for more details.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * Author: huaxz1986@163.com (huaxz)</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#ifndef GENERICPUSHRELABEL</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#define GENERICPUSHRELABEL</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include&lt;memory&gt;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#include&lt;array&gt;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include&lt;vector&gt;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#include&quot;<a class="code" href="header_8h.html">src/header.h</a>&quot;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_introduction_to_algorithm.html">IntroductionToAlgorithm</a></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;{</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    <span class="keyword">namespace </span>GraphAlgorithm</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    {</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        <span class="keyword">template</span>&lt;<span class="keyword">typename</span> GraphType&gt; <span class="keywordtype">void</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#abd520b7e33d8c1e72b05210d784ac258">   67</a></span>&#160;        <a class="code" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#abd520b7e33d8c1e72b05210d784ac258">push</a> (std::shared_ptr&lt;GraphType&gt; graph,<span class="keyword">typename</span> GraphType::VIDType u_id,<span class="keyword">typename</span> GraphType::VIDType v_id,</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;                  std::array&lt;std::array&lt;typename GraphType::EWeightType,GraphType::NUM&gt;,GraphType::NUM&gt;&amp;flow)</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        {</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;            <span class="keyword">typedef</span> <span class="keyword">typename</span> GraphType::EWeightType EWeightType;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;            <span class="keywordflow">if</span>(!graph)</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;push error: graph must not be nullptr!&quot;</span>);</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;            <span class="keywordflow">if</span>(u_id&lt;0||u_id&gt;=GraphType::NUM||v_id&lt;0||v_id&gt;=GraphType::NUM)</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;push error:id must &gt;=0 and &lt;N.&quot;</span>);</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;            <span class="keywordflow">if</span>(!graph-&gt;vertexes.at(u_id) || !graph-&gt;vertexes.at(v_id))</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;push error: vertex of id does not exist.&quot;</span>);</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;            EWeightType c_f; <span class="comment">//c_f(u,v)</span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;            EWeightType delt_f;<span class="comment">//delt_f(u,v)</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;            <span class="keywordflow">if</span>(graph-&gt;vertexes[u_id]-&gt;key==0)</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;push error:u.e must &gt;0 !&quot;</span>);</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;            <span class="comment">//***********  获取 c_f(u,v) ***********</span></div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;            <span class="keywordflow">if</span>(graph-&gt;has_edge(u_id,v_id)) <span class="comment">//(u,v)属于E</span></div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;                c_f=graph-&gt;weight(u_id,v_id)-flow[u_id][v_id]; <span class="comment">// c_f(u,v)=c(u,v)-f(u,v)</span></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;            <span class="keywordflow">else</span> <span class="keywordflow">if</span>(graph-&gt;has_edge(v_id,u_id)) <span class="comment">//(v,u)属于E</span></div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;                c_f=flow[v_id][u_id]; <span class="comment">//c_f(u,v)=f(v,u)</span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;push error: must be (u,v) in E or (v,u) in E!&quot;</span>);</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;            <span class="keywordflow">if</span>(c_f==0) <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;push error:must be c_f &gt; 0!&quot;</span>);</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;            <span class="comment">//************ 获取 /delt_f(u,v) *********</span></div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;            delt_f=std::min(graph-&gt;vertexes[u_id]-&gt;key,c_f);</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;            <span class="comment">//************ 更新 flow *************</span></div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;            <span class="keywordflow">if</span>(graph-&gt;has_edge(u_id,v_id)) <span class="comment">//(u,v)属于E</span></div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;                flow[u_id][v_id]+=delt_f;</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;            <span class="keywordflow">else</span> <span class="keywordflow">if</span>(graph-&gt;has_edge(v_id,u_id)) <span class="comment">//(v,u)属于E</span></div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;                flow[v_id][u_id]-=delt_f;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;push error: must be (u,v) in E or (v,u) in E!&quot;</span>);</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;            <span class="comment">//************ 更新 e ***************</span></div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;            graph-&gt;vertexes[u_id]-&gt;key -= delt_f;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;            graph-&gt;vertexes[v_id]-&gt;key += delt_f;</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        }</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div>
<div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#a27dfe859312abba6639bca7b232d4bd6">  124</a></span>&#160;        <span class="keyword">template</span>&lt;<span class="keyword">typename</span> GraphType&gt; <span class="keyword">typename</span> GraphType::VIDType <a class="code" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#a27dfe859312abba6639bca7b232d4bd6">min_v_at_Ef</a>(std::shared_ptr&lt;GraphType&gt; graph,<span class="keyword">typename</span> GraphType::VIDType u_id,</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;                                                     <span class="keyword">const</span> std::array&lt;std::array&lt;typename GraphType::EWeightType,GraphType::NUM&gt;,GraphType::NUM&gt;&amp;flow)</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        {</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;            <span class="keyword">typedef</span> <span class="keyword">typename</span> GraphType::EWeightType EWeightType;</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;            <span class="keyword">typedef</span> <span class="keyword">typename</span> GraphType::VIDType VIDType;</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;            <span class="keyword">typedef</span> std::array&lt;std::array&lt;EWeightType,GraphType::NUM&gt;,GraphType::NUM&gt; MatrixType;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;            <span class="keywordflow">if</span>(!graph)</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;min_v_at_Ef error: graph must not be nullptr!&quot;</span>);</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;            <span class="keywordflow">if</span>(u_id&lt;0||u_id&gt;=GraphType::NUM)</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;min_v_at_Ef error:id must &gt;=0 and &lt;N.&quot;</span>);</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;            <span class="keywordflow">if</span>(!graph-&gt;vertexes.at(u_id))</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;min_v_at_Ef error: vertex of id does not exist.&quot;</span>);</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;            std::vector&lt;VIDType&gt; Ef_v; <span class="comment">// {v:(u,v)属于Ef}</span></div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;            <span class="keyword">const</span> MatrixType&amp; matrix_graph=graph-&gt;matrix.matrix; <span class="comment">//图的矩阵描述</span></div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;            <span class="keyword">auto</span> invalid_weight=graph-&gt;matrix.invalid_weight; <span class="comment">//无效权重</span></div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;            <span class="comment">//*************  获取所有边(u,v)属于E_f(残留网络G_f中的边)的结点 v *************</span></div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;            <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0;i&lt;GraphType::NUM;i++)</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;            {</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;                <span class="keyword">auto</span> c_u_v=matrix_graph[u_id][i];</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;                <span class="keywordflow">if</span>(c_u_v!=invalid_weight) <span class="comment">//(u,v)属于E</span></div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;                    <span class="keywordflow">if</span>(flow[u_id][i]&lt;c_u_v) <span class="comment">// f(u,v)&lt;c(u,v)</span></div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;                        Ef_v.push_back(i);</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;                <span class="keyword">auto</span> c_v_u=matrix_graph[i][u_id];</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;                <span class="keywordflow">if</span>(c_v_u!=invalid_weight) <span class="comment">//(v,u)属于E</span></div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;                    <span class="keywordflow">if</span>(flow[i][u_id]&gt;0) <span class="comment">// f(v,u)&gt;0</span></div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;                        Ef_v.push_back(i);</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;            }</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;            <span class="keywordtype">int</span> min_h=unlimit&lt;int&gt;();</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;            VIDType v_id=-1;</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;            <span class="keywordflow">for</span>(<span class="keyword">const</span> <span class="keyword">auto</span>&amp; <span class="keywordtype">id</span>:Ef_v)</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;                <span class="keywordflow">if</span>(graph-&gt;vertexes[<span class="keywordtype">id</span>]-&gt;h&lt;min_h)</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;                {</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;                    min_h=graph-&gt;vertexes[id]-&gt;h;</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;                    v_id=id;</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;                }</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;            <span class="keywordflow">return</span> v_id;</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;        }</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;</div>
<div class="line"><a name="l00184"></a><span class="lineno"><a class="line" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#a143924362cc9f23ca452c3ca0e292ff3">  184</a></span>&#160;        <span class="keyword">template</span>&lt;<span class="keyword">typename</span> GraphType&gt; <span class="keywordtype">void</span> <a class="code" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#a143924362cc9f23ca452c3ca0e292ff3">relabel</a>(std::shared_ptr&lt;GraphType&gt; graph,<span class="keyword">typename</span> GraphType::VIDType u_id,</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;                                                  <span class="keyword">const</span> std::array&lt;std::array&lt;typename GraphType::EWeightType,GraphType::NUM&gt;,GraphType::NUM&gt;&amp;flow)</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;        {</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;            <span class="keywordflow">if</span>(!graph)</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;relabel error: graph must not be nullptr!&quot;</span>);</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;            <span class="keywordflow">if</span>(u_id&lt;0||u_id&gt;=GraphType::NUM)</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;relabel error:id must &gt;=0 and &lt;N.&quot;</span>);</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;            <span class="keywordflow">if</span>(!graph-&gt;vertexes.at(u_id))</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;relabel error: vertex of id does not exist.&quot;</span>);</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;            <span class="keywordflow">if</span>(graph-&gt;vertexes[u_id]-&gt;key==0)</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;relabel error:u.e must &gt;0 !&quot;</span>);</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;            <span class="keyword">auto</span> min_v_id=<a class="code" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#a27dfe859312abba6639bca7b232d4bd6">min_v_at_Ef</a>(graph,u_id,flow);</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;            <span class="keywordflow">if</span>(min_v_id&lt;0)</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;relabel error: there must be edges in E_f start from u !&quot;</span>);</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;            <span class="keywordflow">if</span>(graph-&gt;vertexes[u_id]-&gt;h&gt; graph-&gt;vertexes[min_v_id]-&gt;h)</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;relabel error: u.h already &gt; min_v.h !&quot;</span>);</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;            graph-&gt;vertexes[u_id]-&gt;h=1+graph-&gt;vertexes[min_v_id]-&gt;h;</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;        }</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div>
<div class="line"><a name="l00227"></a><span class="lineno"><a class="line" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#aeaf3e258f5ae9aed76158255fa603c00">  227</a></span>&#160;        <span class="keyword">template</span>&lt;<span class="keyword">typename</span> GraphType&gt; <span class="keywordtype">void</span> <a class="code" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#aeaf3e258f5ae9aed76158255fa603c00">initialize_preflow</a>(std::shared_ptr&lt;GraphType&gt; graph,<span class="keyword">typename</span> GraphType::VIDType src,</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;                         std::array&lt;std::array&lt;typename GraphType::EWeightType,GraphType::NUM&gt;,GraphType::NUM&gt;&amp;flow)</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;        {</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;                <span class="keywordflow">if</span>(!graph)</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;                    <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;initialize_preflow error: graph must not be nullptr!&quot;</span>);</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;                <span class="keywordflow">if</span>(src&lt;0||src&gt;=GraphType::NUM)</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;                    <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;initialize_preflow error:id must &gt;=0 and &lt;N.&quot;</span>);</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;                <span class="keywordflow">if</span>(!graph-&gt;vertexes.at(src))</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;                    <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;initialize_preflow error: vertex of id does not exist.&quot;</span>);</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;                <span class="comment">//*********** 所有结点的 e为0, h为0 ***********</span></div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;                <span class="keywordflow">for</span>(<span class="keyword">auto</span>&amp; v:graph-&gt;vertexes)</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;                {</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;                     v-&gt;h=0;</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;                     v-&gt;key=0;</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;                }</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;                <span class="comment">//************* 所有预流为0  **************</span></div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;                <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0;i&lt;GraphType::NUM;i++)</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;                    <span class="keywordflow">for</span>(<span class="keywordtype">int</span> j=0;j&lt;GraphType::NUM;j++)</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;                        flow[i][j]=0;</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;                graph-&gt;vertexes[src]-&gt;h=GraphType::NUM; <span class="comment">// h(s)= |V|</span></div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;                <span class="comment">//**************  对s出发的边调整  *************</span></div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;                <span class="keyword">auto</span> edges=graph-&gt;vertex_edge_tuples(src);</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;                <span class="keywordflow">for</span>(<span class="keyword">const</span> <span class="keyword">auto</span>&amp;edge:edges)</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;                {</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;                    <span class="keyword">auto</span> v_id=std::get&lt;1&gt;(edge); <span class="comment">//{v:(s,v)属于E}</span></div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;                    <span class="keyword">auto</span> c_s_v=std::get&lt;2&gt;(edge);<span class="comment">// c(s,v)</span></div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;                    flow[src][v_id]=c_s_v; <span class="comment">//f(s,v)</span></div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;                    graph-&gt;vertexes[v_id]-&gt;key=c_s_v; <span class="comment">// v.e=c(s,v)</span></div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;                    graph-&gt;vertexes[src]-&gt;key -=c_s_v; <span class="comment">// s.e-=c(s,v)</span></div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;                }</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;        }</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;</div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;        <span class="keyword">template</span>&lt;<span class="keyword">typename</span> GraphType&gt; std::array&lt;std::array&lt;typename GraphType::EWeightType,GraphType::NUM&gt;,GraphType::NUM&gt;</div>
<div class="line"><a name="l00373"></a><span class="lineno"><a class="line" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#ab134ec014d01e25ec2ed7d2c97babe23">  373</a></span>&#160;        <a class="code" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#ab134ec014d01e25ec2ed7d2c97babe23">generic_push_relabel</a>(std::shared_ptr&lt;GraphType&gt; graph,<span class="keyword">typename</span> GraphType::VIDType src,<span class="keyword">typename</span> GraphType::VIDType dst)</div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;        {</div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;               <span class="keyword">typedef</span> <span class="keyword">typename</span> GraphType::EWeightType EWeightType;</div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;               <span class="keyword">typedef</span> std::array&lt;std::array&lt;EWeightType,GraphType::NUM&gt;,GraphType::NUM&gt; MatrixType;</div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;                <span class="keywordflow">if</span>(!graph)</div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;                    <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;generic_push_relabel error: graph must not be nullptr!&quot;</span>);</div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;                <span class="keywordflow">if</span>(src&lt;0||src&gt;=GraphType::NUM||dst&lt;0||dst&gt;=GraphType::NUM)</div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;                    <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;generic_push_relabel error:id must &gt;=0 and &lt;N.&quot;</span>);</div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;                <span class="keywordflow">if</span>(!graph-&gt;vertexes.at(src) || !graph-&gt;vertexes.at(dst))</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;                    <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;generic_push_relabel error: vertex of id does not exist.&quot;</span>);</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;               MatrixType flow;</div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;               <a class="code" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#aeaf3e258f5ae9aed76158255fa603c00">initialize_preflow</a>(graph,src,flow);</div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;               <span class="keywordflow">while</span>(<span class="keyword">true</span>)</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;               {</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;                  <span class="keywordtype">int</span> u_index;</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;                  <span class="comment">//*********** 寻找 溢出结点 ***********</span></div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;</div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;                  <span class="keywordtype">bool</span> has_no_overflow=<span class="keyword">true</span>;</div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;                  <span class="keywordflow">for</span>(u_index=0;u_index&lt;GraphType::NUM;u_index++)</div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;                  {</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;                     <span class="keywordflow">if</span>(u_index==src||u_index==dst) <span class="keywordflow">continue</span>; <span class="comment">//跳过源点和汇点</span></div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;                     <span class="keywordflow">if</span>(graph-&gt;vertexes[u_index]-&gt;key&gt;0) <span class="comment">//有溢出结点</span></div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;                     {</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;                         has_no_overflow=<span class="keyword">false</span>;</div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;                         <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;                     }</div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;                  }</div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;</div>
<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;                  <span class="keywordflow">if</span>(has_no_overflow) <span class="keywordflow">break</span>; <span class="comment">//没有溢出结点</span></div>
<div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;                  <span class="keywordflow">else</span> <span class="comment">//存在溢出结点</span></div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;                  {</div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;                      <span class="keyword">auto</span> v_id=<a class="code" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#a27dfe859312abba6639bca7b232d4bd6">min_v_at_Ef</a>(graph,u_index,flow);</div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;                      <span class="keywordflow">if</span>(graph-&gt;vertexes[u_index]-&gt;h &gt; graph-&gt;vertexes[v_id]-&gt;h) <span class="comment">//满足push条件</span></div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;                      {</div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;                          <a class="code" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#abd520b7e33d8c1e72b05210d784ac258">push</a>(graph,u_index,v_id,flow);</div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;                      }</div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;                      <span class="keywordflow">else</span></div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;                      {</div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;                          <a class="code" href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#a143924362cc9f23ca452c3ca0e292ff3">relabel</a>(graph,u_index,flow);</div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;                      }</div>
<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;                  }</div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;</div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;               }</div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;               <span class="keywordflow">return</span> flow;</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;        }</div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;    }</div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;}</div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;<span class="preprocessor">#endif // GENERICPUSHRELABEL</span></div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;</div>
<div class="ttc" id="header_8h_html"><div class="ttname"><a href="header_8h.html">header.h</a></div></div>
<div class="ttc" id="namespace_introduction_to_algorithm_1_1_graph_algorithm_html_a143924362cc9f23ca452c3ca0e292ff3"><div class="ttname"><a href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#a143924362cc9f23ca452c3ca0e292ff3">IntroductionToAlgorithm::GraphAlgorithm::relabel</a></div><div class="ttdeci">void relabel(std::shared_ptr&lt; GraphType &gt; graph, typename GraphType::VIDType u_id, const std::array&lt; std::array&lt; typename GraphType::EWeightType, GraphType::NUM &gt;, GraphType::NUM &gt; &amp;flow)</div><div class="ttdoc">relabel：generic_push_relabel算法的relabel操作。算法导论26章26.4节 </div><div class="ttdef"><b>Definition:</b> <a href="genericpushrelabel_8h_source.html#l00184">genericpushrelabel.h:184</a></div></div>
<div class="ttc" id="namespace_introduction_to_algorithm_1_1_graph_algorithm_html_ab134ec014d01e25ec2ed7d2c97babe23"><div class="ttname"><a href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#ab134ec014d01e25ec2ed7d2c97babe23">IntroductionToAlgorithm::GraphAlgorithm::generic_push_relabel</a></div><div class="ttdeci">std::array&lt; std::array&lt; typename GraphType::EWeightType, GraphType::NUM &gt;, GraphType::NUM &gt; generic_push_relabel(std::shared_ptr&lt; GraphType &gt; graph, typename GraphType::VIDType src, typename GraphType::VIDType dst)</div><div class="ttdoc">generic_push_relabel：最大流的推送-重贴标签算法。算法导论26章26.4节 </div><div class="ttdef"><b>Definition:</b> <a href="genericpushrelabel_8h_source.html#l00373">genericpushrelabel.h:373</a></div></div>
<div class="ttc" id="namespace_introduction_to_algorithm_1_1_graph_algorithm_html_a27dfe859312abba6639bca7b232d4bd6"><div class="ttname"><a href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#a27dfe859312abba6639bca7b232d4bd6">IntroductionToAlgorithm::GraphAlgorithm::min_v_at_Ef</a></div><div class="ttdeci">GraphType::VIDType min_v_at_Ef(std::shared_ptr&lt; GraphType &gt; graph, typename GraphType::VIDType u_id, const std::array&lt; std::array&lt; typename GraphType::EWeightType, GraphType::NUM &gt;, GraphType::NUM &gt; &amp;flow)</div><div class="ttdoc">min_v_at_Ef：relabel操作中的min_v_at_Ef操作。算法导论26章26.4节 </div><div class="ttdef"><b>Definition:</b> <a href="genericpushrelabel_8h_source.html#l00124">genericpushrelabel.h:124</a></div></div>
<div class="ttc" id="namespace_introduction_to_algorithm_1_1_graph_algorithm_html_abd520b7e33d8c1e72b05210d784ac258"><div class="ttname"><a href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#abd520b7e33d8c1e72b05210d784ac258">IntroductionToAlgorithm::GraphAlgorithm::push</a></div><div class="ttdeci">void push(std::shared_ptr&lt; GraphType &gt; graph, typename GraphType::VIDType u_id, typename GraphType::VIDType v_id, std::array&lt; std::array&lt; typename GraphType::EWeightType, GraphType::NUM &gt;, GraphType::NUM &gt; &amp;flow)</div><div class="ttdoc">push：generic_push_relabel算法的push操作。算法导论26章26.4节 </div><div class="ttdef"><b>Definition:</b> <a href="genericpushrelabel_8h_source.html#l00067">genericpushrelabel.h:67</a></div></div>
<div class="ttc" id="namespace_introduction_to_algorithm_1_1_graph_algorithm_html_aeaf3e258f5ae9aed76158255fa603c00"><div class="ttname"><a href="namespace_introduction_to_algorithm_1_1_graph_algorithm.html#aeaf3e258f5ae9aed76158255fa603c00">IntroductionToAlgorithm::GraphAlgorithm::initialize_preflow</a></div><div class="ttdeci">void initialize_preflow(std::shared_ptr&lt; GraphType &gt; graph, typename GraphType::VIDType src, std::array&lt; std::array&lt; typename GraphType::EWeightType, GraphType::NUM &gt;, GraphType::NUM &gt; &amp;flow)</div><div class="ttdoc">initialize_preflow：generic_push_relabel算法的初始化操作。算法导论26章26.4节 </div><div class="ttdef"><b>Definition:</b> <a href="genericpushrelabel_8h_source.html#l00227">genericpushrelabel.h:227</a></div></div>
<div class="ttc" id="namespace_introduction_to_algorithm_html"><div class="ttname"><a href="namespace_introduction_to_algorithm.html">IntroductionToAlgorithm</a></div><div class="ttdoc">Namespace of IntrodunctionToAlgorithm. </div><div class="ttdef"><b>Definition:</b> <a href="longest__common__subsequence_8h_source.html#l00024">longest_common_subsequence.h:24</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_8ed9dba4cd616b67da9b1338594e34e0.html">src</a></li><li class="navelem"><a class="el" href="dir_aa0a5ddea82682e3e6fbdbaa3337ee0e.html">graph_algorithms</a></li><li class="navelem"><a class="el" href="dir_a4fbac2a12224e4d8b34a92a8974f6d5.html">max_flow</a></li><li class="navelem"><a class="el" href="dir_e659e7b9c34376fac415f94ae80615c7.html">generic_push_relabel</a></li><li class="navelem"><a class="el" href="genericpushrelabel_8h.html">genericpushrelabel.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.10 </li>
  </ul>
</div>
</body>
</html>
